import request from '@/api/request.js'

// 订单个数
export async function orderTypeNum(params) {
	return request('/order/typeNum', params)
}

// 商品详情
export async function goodsDetailBy(params) {
	return request('/goods/getGoodsDetailById', params)
}

// 获取商品规格信息
export async function getGoodsSkuInfo(params) {
	return request('/goods/getGoodsSkuInfo', params)
}

// 收藏
export async function collect(params) {
	return request('/goodsCollect/collect', params, 'post')
}

// 取消收藏
export async function cancelCollect(params) {
	return request('/goodsCollect/cancelCollect', params, 'post')
}

// 立即购买
export async function generateOrder(params) {
	return request('/order/buyFast/generateOrder', params, 'post')
}

// 加入购物车
export async function addShoppingCart(params) {
	return request('/cart/add', params, 'post')
}

// 订单预览
export async function orderPreview(params) {
	return request('/order/preview', params, 'post')
}

// 订单生成
export async function placeOrder(params) {
	return request('/order/generate', params, 'post')
}

// 订单详情
export async function orderDetail(params) {
	return request('/order/toBePay/detail', params)
}

// 支付
export async function payment(params) {
	return request('/order/choicePayment', params, 'post')
}

//获取订单列表
export async function orderList(params) {
	return request('/order/orderList', params)
}

// 确认收货
export async function finishReceiving(params) {
	return request('/order/finishReceiving', params, 'post')
}

// 取消订单
export async function applyCancelOrder(params) {
	return request('/order/applyCancelOrder', params, 'post')
}

// 修改规格
export async function updateSku(params) {
	return request('/cart/updateSku', params, 'post')
}

// 上传支付凭证
export async function uploadPaymentVoucher(params) {
	return request('/order/uploadPaymentVoucher', params, 'post')
}

// 查看商品发货信息
export async function sendDeliveryInfo(params) {
	return request('/goods/getDeliveryInfoById', params)
}

// 获取更多商品信息
export async function sendMoreGoodsInfo(params) {
	return request('/goods/getMoreGoodsInfo', params)
}

// 获取退款凭证
export async function getRefundVoucherByOrderId(params) {
	return request('/order/getRefundVoucherByOrderId', params)
}

// 获取行业车品牌试用车型
export async function sendvinLibraryApplicableModels(params) {
	return request('/vinLibrary/getApplicableModels', params)
}

export const getOrderDetail = (params) => {
	return request('/order/getOrderIsPaySuccess', params)
}

export const getPaymentDetail = params => (
	request('/pacyPay/getPayInfo', params)
)

export const getPayPalPaymentDetail = params => (
	request('/payPal/getPayInfo', params)
)

export const getOceanPayDetail = params => (
	request('/oceanPay/getPayInfo', params)
)

export const handleBusinessSaveAction = params => (
	request('/distributor/save', params, 'POST')
)

export const getBusinessDataAction = params => (
	request('/distributor/detailsByStoreId', params)
)

export const handleBusinessUpdateAction = params => (
	request('/distributor/update', params, 'POST')
)

export const getGoodsSeoConfigAction = params => (
	request('/userSeoConfiguration/goods/detail', params)
)

export const getGoodsSkuList = params => (
	request('/goods/getSpecificationMainById', params, 'GET')
)

export const payCheck = params => (
	request('/wallet/pay/check', params)
)
